<template>
  <div class="navMenu">
    <div v-for="navMenu in navMenus" :key="navMenu.entity.name">
      <el-menu-item
        v-if="navMenu.childs==null&&navMenu.entity&&navMenu.entity.state==='ENABLE'"
        :key="navMenu.entity.id"
        :data="navMenu"
        :index="navMenu.entity.name"
        :route="navMenu.entity.url" @click="childClick(navMenu.entity.name)">
          <i :class="navMenu.entity.icon"></i>
        <span slot="title">{{navMenu.entity.alias}}</span>
      </el-menu-item>
      <el-submenu
        v-if="navMenu.childs&&navMenu.entity&&navMenu.entity.state==='ENABLE'"
        :key="navMenu.entity.id"
        :data="navMenu"
        :index="navMenu.entity.name"
      >
        <template slot="title">
          <i :class="navMenu.entity.icon"></i>
          <span>{{navMenu.entity.alias}}</span>
        </template>
        <NavMenu :navMenus="navMenu.childs" class="navMenusC"></NavMenu>
      </el-submenu>
    </div>
  </div>
</template>
 
<script>
export default {
  name: "NavMenu",
  props: ["navMenus"],
  data() {
    return {
    };
  },
  methods: {
    childClick(menuav){
      let _this=this;
         _this.$emit('menuav',menuav)
    }
  }
};
</script>
 